home *** CD-ROM | disk | FTP | other *** search
/ PC World 2007 January / PCWorld_2007-01_cd.bin / v cisle / autoit / autoit-v3.2.0.1-setup.exe / Examples / Helpfile / _GUICtrlComboGetEditSel.au3 < prev    next >
Text File  |  2006-06-17  |  812b  |  30 lines

  1. #include <GuiConstants.au3>
  2. #include <GuiCombo.au3>
  3.  
  4. opt('MustDeclareVars', 1)
  5.  
  6. Dim $Combo, $Btn_Exit, $msg, $Status
  7.  
  8. GUICreate("ComboBox Get Edit Sel", 392, 254)
  9.  
  10. $Combo = GUICtrlCreateCombo("", 70, 10, 270, 100, $CBS_SIMPLE)
  11. GUICtrlSetData($Combo, "AutoIt|v3|is|freeware|BASIC-like|scripting|language", "freeware")
  12. $Btn_Exit = GUICtrlCreateButton("Exit", 150, 200, 90, 30)
  13.  
  14. $Status = GUICtrlCreateLabel("", 0, 234, 392, 20, BitOR($SS_SUNKEN, $SS_CENTER))
  15.  
  16. GUISetState()
  17. Local $a_sel = _GUICtrlComboGetEditSel($Combo)
  18. If (IsArray($a_sel)) Then
  19.    GUICtrlSetData($Status, "Chars Position Selected From: " & $a_sel[1] & " To: " & $a_sel[2])
  20. EndIf
  21.  
  22. While 1
  23.    $msg = GUIGetMsg()
  24.    Select
  25.       Case $msg = $GUI_EVENT_CLOSE Or $msg = $Btn_Exit
  26.          ExitLoop
  27.    EndSelect
  28. WEnd
  29. Exit
  30.